/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.me.backing.login;

import javax.annotation.PostConstruct;
import javax.faces.context.FacesContext;
import org.apache.myfaces.trinidad.component.core.input.CoreInputText;

/**
 *
 * @author Jayasundara
 */
public class Login {
    private CoreInputText userId;
    private CoreInputText password;

    public CoreInputText getPassword() {
        return password;
    }

    public void setPassword(CoreInputText password) {
        this.password = password;
    }
    public CoreInputText getUserId() {
//        userId.setLabel("Email:");
        return userId;
    }

    public void setUserId(CoreInputText userId) {
        this.userId = userId;
    }

    public String loginAction(){
        System.out.println("userId : "+userId.getValue());
        System.out.println("pw : "+password.getValue());
        Object o = FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().get("entityManager");
        System.out.println("em :::::::::: "+o);
        return "success";
    }

    @PostConstruct
    public void prerender() {
//        userId = new CoreInputText();
//        userId.setValue("preRender");
//        System.out.println("preender");
    }
}
